package repository;

import bdzeitor.Conexao;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

public class ContaDAO {
    public ArrayList<String> listaResult;
    public ArrayList<String> quantPar;
    
    public void save(String sql) throws SQLException{
        Conexao conexao = new Conexao();
        conexao.getConnection().prepareStatement(sql).executeUpdate();
    }
    
    public void read(String sql) throws SQLException{
        Conexao conexao = new Conexao();
        ResultSet result = null;

        result = conexao.getConnection().prepareStatement(sql).executeQuery();
        
        this.listaResult = new ArrayList<>();
        this.quantPar = new ArrayList<>();
        
        while (result.next()) {
            listaResult.add(result.getString(1));
            quantPar.add(result.getString(2));
        }
    }
}
